package com.ssy.lingxi.search.service;

import com.ssy.lingxi.common.constant.tree.Node;
import com.ssy.lingxi.common.model.dto.UserLoginCacheDTO;
import com.ssy.lingxi.common.response.PageData;
import com.ssy.lingxi.search.api.model.request.channel.ChannelCommoditySearchRequest;
import com.ssy.lingxi.search.api.model.response.AttributeResponse;
import com.ssy.lingxi.search.api.model.response.BrandResponse;
import com.ssy.lingxi.search.api.model.response.ProvinceResponse;
import com.ssy.lingxi.search.api.model.response.channel.ChannelCommodityDetailResponse;
import com.ssy.lingxi.search.api.model.response.channel.ChannelCommoditySearchResponse;
import com.ssy.lingxi.search.entity.Commodity;

import java.util.List;

/**
 * 渠道商城搜索管理类
 * @author jw.chen
 * @version 2.0.0
 * @date 2020/8/28
 */
public interface IChannelShopService {

    /**
     * 查询商品品类树
     * @return
     */
    List<Node> getCategoryTree(Long channelMemberIdList, Long shopId);

    /**
     * 查询属性
     * @return
     */
    List<AttributeResponse> getAttributeByCategoryId(Long shopId, Long channelMemberId, Long categoryId);

    /**
     * 查询商品品牌
     * @return
     */
    List<BrandResponse> getBrand(Long channelMemberId, Long shopId, Long customerCategoryId);

    /**
     * 查询归属地市
     * @return
     */
    List<ProvinceResponse> getArea(Long shopId, Long channelMemberId);

    /**
     * 查询渠道商品最大价格/最大积分
     * @return
     */
    Double getCommodityMaxPrice(Long channelMemberId);

    /**
     * 查询商品详情
     * @param commodityId
     * @param channelMemberId
     * @param sysUser
     * @return
     */
    ChannelCommodityDetailResponse getCommodityDetail(Long shopId, Long commodityId, Long channelMemberId, UserLoginCacheDTO sysUser);

    /**
     * 通过商品skuId查询商品详情
     * @param commoditySkuId
     * @param channelMemberId
     * @param sysUser
     * @return
     */
    ChannelCommodityDetailResponse getCommodityDetailBySkuId(Long shopId, Long commoditySkuId, Long channelMemberId, UserLoginCacheDTO sysUser);

    /**
     * 查询商品库存
     * @param commodity
     * @param channelMemberId
     * @param sysUser
     * @return
     */
    ChannelCommodityDetailResponse getCommodityStock(Long shopId, Commodity commodity, Long channelMemberId, UserLoginCacheDTO sysUser);

    /**
     * 查询商品列表
     * @param channelCommoditySearchRequest
     * @param isHighlight
     * @return
     */
    PageData<ChannelCommoditySearchResponse> searchCommodityList(UserLoginCacheDTO sysUser, ChannelCommoditySearchRequest channelCommoditySearchRequest, Boolean isHighlight, Boolean isScoreShop);

    /**
     * 根据条件查询商品信息
     * @param channelCommoditySearchRequest     搜索条件
     * @param isHighlight   是否高亮显示
     */
    PageData<Commodity> getCommodityList(ChannelCommoditySearchRequest channelCommoditySearchRequest, Boolean isHighlight);
}
